extends Area2D

func _ready() -> void:
	body_entered.connect(on_body_entered)
	var tween = create_tween()
	tween.set_loops()
	#tween.set_ease(Tween.EASE_IN_OUT).set_trans(Tween.TRANS_CUBIC)
	tween.tween_property($Sprite2D, "rotation_degrees", 360,.5)
	tween.tween_property($Sprite2D, "rotation_degrees", 0,.5)


func on_body_entered(body: Node2D) -> void:
	MusicPlayer.play_sfx("Star")
	DialogHandler.star += 1
	$AnimationPlayer.play("fly")
